package com.letv.android.client.episode.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

public class ResizeLayout extends RelativeLayout {
    
	private OnResizeListener mResizeListener = null;
	public static final byte KEYBOARD_STATE_SHOW = -3;
	public static final byte KEYBOARD_STATE_HIDE = -2;
	public static final byte KEYBOARD_STATE_INIT = -1;

	public interface OnResizeListener { 
        void onResize(int w, int h, int oldw, int oldh); 
    } 
	
    public ResizeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ResizeLayout(Context context) {
        this(context, null);
    }

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		super.onLayout(changed, l, t, r, b);
	}

	@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		super.onSizeChanged(w, h, oldw, oldh);
		
		if (mResizeListener != null) {
			mResizeListener.onResize(w, h, oldw, oldh);
		}
	}
	
	public void setOnKeyBordResizeListener(OnResizeListener listener) {
		this.mResizeListener = listener;
	}
}
